Skip to content

Conversation

@YanYablonovskiy
Copy link
Contributor

@YanYablonovskiy YanYablonovskiy commented Jan 16, 2026

Adding the basic definitions around order types, the equivalence classes of linear orders under order isomorphism.


See draft discussion at #33420 and refactoring task #28278 .

Open in Gitpod

@github-actions github-actions bot added new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-order Order theory labels Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

PR summary 721b21cf2b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Order.Types.Defs (new file) 183

Declarations diff

+ OrderType
+ OrderType.instSetoid
+ ToType
+ bot_eq_zero
+ inductionOn
+ inductionOn₂
+ inductionOn₃
+ instance (o : OrderType) : LinearOrder o.ToType
+ instance : Inhabited OrderType
+ instance : NeZero (1 : OrderType)
+ instance : Nontrivial OrderType.{u}
+ instance : One OrderType
+ instance : OrderBot OrderType
+ instance : Preorder OrderType
+ instance : Zero OrderType
+ liftOn
+ liftOn_type
+ not_lt_zero
+ omega0
+ pos_iff_ne_zero
+ type
+ type_congr
+ type_eq_one
+ type_eq_type
+ type_eq_zero
+ type_le_type
+ type_le_type_iff
+ type_lt_type
+ type_ne_zero
+ type_ne_zero_iff
+ type_of_isEmpty
+ type_of_unique
+ type_toType
+ zero_le

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@YanYablonovskiy YanYablonovskiy marked this pull request as ready for review January 16, 2026 09:31
@YanYablonovskiy YanYablonovskiy changed the title feat(Order): Adding OrderTypes definitions feat(Order): Adding OrderType definitions Jan 16, 2026
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

🚨 PR Title Needs Formatting

Please update the title to match our commit style conventions.

Errors from script:

error: the PR title should be of the form
  abbrev: main title
or
  abbrev(scope): main title
Details on the required title format

The title should fit the following format:

<kind>(<optional-scope>): <subject>

<kind> is:

  • feat (feature)
  • fix (bug fix)
  • doc (documentation)
  • style (formatting, missing semicolons, ...)
  • refactor
  • test (when adding missing tests)
  • chore (maintain)
  • perf (performance improvement, optimization, ...)
  • ci (changes to continuous integration, repo automation, ...)

<optional-scope> is a name of module or a directory which contains changed modules.
This is not necessary to include, but may be useful if the <subject> is insufficient.
The Mathlib directory prefix is always omitted.
For instance, it could be

  • Data/Nat/Basic
  • Algebra/Group/Defs
  • Topology/Constructions

<subject> has the following constraints:

  • do not capitalize the first letter
  • no dot(.) at the end
  • use imperative, present tense: "change" not "changed" nor "changes"

@YanYablonovskiy YanYablonovskiy changed the title feat(Order): Adding OrderType definitions feat(Order): adding OrderType definitions Jan 16, 2026
@YanYablonovskiy YanYablonovskiy changed the title feat(Order): adding OrderType definitions feat(Order): add OrderType definitions Jan 16, 2026
@mathlib4-dependent-issues-bot
Copy link
Collaborator

@YaelDillies YaelDillies changed the title feat(Order): add OrderType definitions feat(Order): order types Jan 17, 2026
@YaelDillies YaelDillies added the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 17, 2026
@YanYablonovskiy
Copy link
Contributor Author

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jan 18, 2026
⟨⟨h⟩,hne⟩
⟨⟨h⟩, hne⟩

alias _root_.OrderEmbedding.type_le_type := type_le_type
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be?

Suggested change
alias _root_.OrderEmbedding.type_le_type := type_le_type
alias _root_.OrderEmbedding.orderTypeType_le_orderTypeType := type_le_type

I do find this name extremely clunky. Perhaps we can stretch the naming conventions just a bit?

Suggested change
alias _root_.OrderEmbedding.type_le_type := type_le_type
alias _root_.OrderEmbedding.orderType_le_orderType := type_le_type

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current name is okay if we believe that type here unambiguously refers to OrderType.type, which... I could believe?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also Ordinal.type.

YanYablonovskiy and others added 2 commits January 18, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants